package com.hc.comm.model;


import java.util.HashMap;

import com.alibaba.fastjson.annotation.JSONField;

public class ResultMeta {
	
	@JSONField(name = "code")
	public int code;
	
	@JSONField(name = "msg")
	public String msg;
	
	@JSONField(name = "data")
	public HashMap<String, Object> data;
	/*
	@JSONField(name = "retDataList")
	public ArrayList<Object> retDataList;
	*/
	
	public ResultMeta() {
		code = 1;
		msg = "fail";
		data = new HashMap<String, Object>();
		//retDataList = new ArrayList<Object>();
	}
	
	public void setSuccess(String msg) {
		setResult(0, msg);
	}
	
	public void setResult(String msg) {
		setResult(1, msg);
	}
	
	
	public void setResult(int code, String msg) {
		if (this.code != 0) {
			this.code = code;
			this.msg = msg;
		}

	}
	
}
